﻿CREATE TABLE [dbo].[t_Payment] (
    [ID]                   INT            IDENTITY (1, 1) NOT NULL,
    [LoanID]               INT            NOT NULL,
    [DateScheduled]        SMALLDATETIME  NULL,
    [DateNext]             SMALLDATETIME  NULL,
    [StatusID]             INT            NOT NULL,
    [StatusUser]           VARCHAR (32)   NOT NULL,
    [StatusDate]           SMALLDATETIME  NOT NULL,
    [IntAddOn]             NUMERIC (9, 2) NULL,
    [PrincipalBalance]     NUMERIC (9, 2) NULL,
    [PaymentNumber]        NUMERIC (5, 2) NULL,
    [ExpectedBalance]      NUMERIC (9, 2) NULL,
    [ExpectedPayment]      SMALLINT       NULL,
    [DayCountConventionID] TINYINT        NOT NULL,
    [IsPrinBal]            BIT            NULL,
    [IsProcessed]          BIT            NOT NULL,
    [Interest]             NUMERIC (9, 2) NOT NULL,
    [PrincipalPart]        NUMERIC (9, 2) NOT NULL,
    [InterestPart]         NUMERIC (9, 2) NOT NULL,
    [LateFeePart]          NUMERIC (9, 2) NOT NULL,
    [NSFFeePart]           NUMERIC (9, 2) NOT NULL
);

